import { loginUser } from "@/service/loginRegister";
import { ILoginInfo } from "@/service/loginRegister/types";
import { ActionTree } from "vuex"
import { IUserState } from "./types"
import { IStoreType ,IState} from "../types"
const actions: ActionTree<IUserState, IState> = {
  async loginActions({ commit }, payload: ILoginInfo) {
    console.log("执行了", payload);
    
    const res = await loginUser(payload);
    // res.data.avatar
    console.log("Res:", res);
    commit("saveUserInfo", res)
    return res;
  }
};

export { actions };
